package com.jinhongone.controller;

import com.jinhongone.context.ApplicationContext;
import com.jinhongone.context.support.ClassPathXmlApplicationContext;
import com.jinhongone.service.UserService;

/**
 * @author Administrator
 * @version 1.0
 * @description: 测试自定义ioc
 * @date 2025/4/26 12:54
 */
public class IocVerifyController {

    public static void main(String[] args) throws Exception {
        //创建ioc容器
        ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        //根据容器获取bean
        UserService userService = app.getBean("userService", UserService.class);
        //调用bean方法
        userService.add();
    }
}
